package com.msti.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;

@Entity
public class Employee {

	private long employeeId; 	
	private String name; 	
	private String nicno; 	
	private String phone; 	
	private String role; 	
	private String username; 	
	private String password;
	private String center;
	
	private List<Certificate> certificates = new ArrayList<Certificate>();
	@OneToMany(targetEntity=Certificate.class, mappedBy="employee",
	        cascade=CascadeType.ALL, fetch=FetchType.LAZY)
	public List<Certificate> getCertificates() {
		return certificates;
	}
	public void setCertificates(List<Certificate> certificates) {
		this.certificates = certificates;
	}
	private List<Student> students = new ArrayList<Student>();
	
	@OneToMany(targetEntity=Student.class, mappedBy="employee", cascade=CascadeType.ALL, fetch=FetchType.LAZY)
	public List<Student> getStudents() {
		return students;
	}
	public void setStudents(List<Student> students) {
		this.students = students;
	}
	public String getCenter() {
		return center;
	}
	public void setCenter(String center) {
		this.center = center;
	}
	@Id
	@GeneratedValue
	public long getEmployeeId() {
		return employeeId;
	}
	public void setEmployeeId(long id) {
		this.employeeId = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getNicno() {
		return nicno;
	}
	public void setNicno(String nicno) {
		this.nicno = nicno;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getRole() {
		return role;
	}
	public void setRole(String role) {
		this.role = role;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	
}
